package com.example.g2daylx2.bvm

import androidx.lifecycle.MutableLiveData
import com.example.lib_base.net.ApiService
import com.example.lib_base.net.entity.LoginEntity
import com.example.lib_base.net.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class LongViewModel @Inject constructor(val apiService: ApiService):BaseViewModel() {
    var loginSuccess = MutableLiveData<LoginEntity>()

    fun login(username:String,password:String){
        httpRequest({apiService.login(username, password)},{loginSuccess.value = it})
    }

    var searSuccess = MutableLiveData<LoginEntity>()
    fun sear(username:String,password:String){
        httpRequest({apiService.sear(username, password)},{searSuccess.value = it})
    }


}